<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Main Menu</title>
</head>
<body>
	<%@ page import="tuna.Process" %>
		
	<%
		String day = request.getParameter("day");
		String us = request.getParameter("us");
		String role = request.getParameter("role");
		String id = request.getParameter("id");
		
		if(Process.validate(day, us, role, id)) {
			String parameters = "?day=" + day + "&us=" + us + "&role=" + role + "&id=" + id;
			String profile_param = parameters + "&userId=" + id + "&userName=" + us;
	%>
	
	<table align="center" style="font-family: arial; width: 480px; width: 320px">
		<tr>
			<td>
				<a href="/tuna/news.jsp<%= parameters %>">News Feed</a>
			</td>
			<td>
				<a href="/tuna/viewPost.jsp<%= profile_param %>">Profile</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="/tuna/listFriends.jsp<%= parameters %>">Friends</a>
			</td>
			<td>
				<a href="/tuna/listMessage.jsp<%= parameters %>">Message</a>
			</td>
		</tr>
		<tr>
			<td>
				<%
					if(role.equals("student")) {
				%>
					<a href="/tuna/listProf.jsp<%= parameters %>">Rate Professor</a>
				<%		
					}
					else {
				%>
					<a href="/tuna/viewRate.jsp<%= parameters %>">View Rating</a>
				<%						
					}
				%>
			</td>
			<td>
				<a href="/tuna/searchProf.jsp<%= parameters %>">Search Professor</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="/tuna/setting.jsp<%= parameters %>">Setting</a>
			</td>
		</tr>
	</table>
	
	<%
		}
		else {
			response.sendRedirect("/tuna/login.jsp");
		}
	%>
</body>
</html>